package KK.Role
{
	import KK.Animation.MovieClip;
	
	import flash.display.BitmapData;
	
	public class Role extends MovieClip
	{
		static private var AUTO_INCREMENT:uint;
		static private function get AI():String{
			return String(AUTO_INCREMENT++);
		}
		
		////////////////////////////////////////////////
		static private const UP:String=AI;
		static private const DOWN:String=AI;
		static private const LEFT:String=AI;
		static private const RIGHT:String=AI;
		
		public function Role(width:int,height:int,bitmapData:BitmapData=null, frameRate:uint=24)
		{
			//TODO: implement function
			super(width,height,bitmapData, frameRate);
			addAnimation(UP,[0,1,2]);
			addAnimation(RIGHT,[3,4,5]);
			addAnimation(DOWN,[6,7,8]);
			addAnimation(LEFT,[9,10,11]);
			
		}

		/**
		 * 左边 
		 * 
		 */
		public function goLeft():void{
			playAnimation(LEFT);
		}
		
		/**
		 *右边  
		 * 
		 */
		public function goRight():void{
			playAnimation(RIGHT);
		}
		
		/**
		 * 上 
		 * 
		 */
		public function goUp():void{
			playAnimation(UP);
		}
		
		/**
		 * 下 
		 * 
		 */
		public function goDown():void{
			playAnimation(DOWN);
		}
		
		/**
		 * 重绘 
		 * 
		 */
		override protected function draw():void{
			super.draw(); 
		}
	}
}